package com.shqcjd.generalplatformprojectclient.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.generalplatformprojectclient.R;
import com.shqcjd.generalplatformprojectclient.model.pojo.InviteBean;
import com.shqcjd.generalplatformprojectclient.util.DateUtil;

import java.util.List;

/**
 * 邀请列表适配
 * Created by sy on 2018/12/13.
 */

public class InviteAdapter extends BaseQuickAdapter<InviteBean,BaseViewHolder>{
    public InviteAdapter(@Nullable List<InviteBean> data) {
        super(R.layout.item_invite_layout, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, InviteBean item) {
        helper.setText(R.id.tv_number, item.phoneNumber)
                .setText(R.id.tv_is_register, item.registerStatus == 2 ? "已注册" : "未注册")
                .setText(R.id.tv_invite_time, DateUtil.getDateToString(item.invitationTime,"邀请时间: yyyy-MM-dd HH:mm:ss"))
                .addOnClickListener(R.id.btn_send_remote);

        //设置指导button是否显示
        helper.getView(R.id.fl_send_invite).setVisibility(item.registerStatus == 2 ? View.VISIBLE : View.GONE);


    }

}
